/*
 * CommandProcessor.h
 *
 */

#ifndef COMMANDPROCESSOR_H_
#define COMMANDPROCESSOR_H_

#define ENTITY_EXT ".dat"
#define BLOCK_SIZE 512
#define INNERSORT_SIZE 10
#define MERGE_LINES 4

#include <map>
#include <string>
#include <vector>
#include "../StringRecord.h"

typedef std::string String;

class CommandProcessor {
	public:
		CommandProcessor();
		virtual ~CommandProcessor();

		void massiveLoad(const String& name, const String& file);
		void list(const String& name);
		void findById(const String& name, const String& id);
		void findByValue(const String& name, const String& value);
		void sortById(const String& name);
		void sortByValue(const String& name);
		void listFile(const String& path);

		void remove(const String& name, const String& id);
		void individualLoad(const String& name, const String& id, const String& value);


	private:
		void sort(const String& name, Compare compare);
		void find(const String& name, const IEvaluator<StringRecord>& eval);
};

#endif  /* COMMANDPROCESSOR_H_ */
